;(function(){
//////////////header/////////////////
	var list_Li = document.getElementById('list_li');
	var oList_Li = list_Li.querySelectorAll('li');
	var toTo = document.getElementById('toto')
	for(let i=0;i<oList_Li.length;i++){
		oList_Li[i].onmouseover = function(){
			//console.log(i);
		oList_Li[i].querySelector("a").style.color='#fff';
		oList_Li[i].querySelector("a").style.background='#fabe00';
		}
		oList_Li[i].onmouseout = function(){
			//console.log(i);
			//oList_Li[i].querySelector("a").style.color='#333';
			oList_Li[i].querySelector("a").setAttribute("style","color:#333;background:#fff;")
			oList_Li[i].querySelector("a").style.background='#fff';
			
		}
	}
	////////////header-app//////////////////////
	var app = document.getElementById("app");
	app.onmouseover = function(){
		app.getElementsByTagName("div")[0].style.display = "block"
	}
	app.onmouseout = function(){
		app.getElementsByTagName("div")[0].style.display = "none"
	}
		
	
	
	
	///////////轮播///////////////////
	var swiper = new Swiper('.swiper-container2', {
      slidesPerView: 4,
      spaceBetween: 11,
      // init: false,
//    pagination: {
//      el: '.swiper-pagination',
//      clickable: true,
//    },
      breakpoints:{
        1024: {
          slidesPerView: 4,
          spaceBetween: 30,
        },
        768: {
          slidesPerView: 3,
          spaceBetween: 20,
        },
        640: {
          slidesPerView: 2,
          spaceBetween: 10,
        },
        320: {
          slidesPerView: 1,
          spaceBetween: 10,
        }
      }
    });
})()

;(function(){
	var brandMore = document.getElementById('brandMore');
	brandMore.onmouseover = function(){
		brandMore.style.color = "#3b9bff"
	}
	brandMore.onmouseout = function(){
		brandMore.style.color = "#000"
	}
})()
////////////固定区//////////////
var guding = document.getElementById("guding");
var gudingLi = guding.getElementsByTagName("li")[1];
gudingLi.onmouseover= function(){
	gudingLi.getElementsByTagName("div")[0].style.display = "block";
}
gudingLi.onmouseout= function(){
	gudingLi.getElementsByTagName("div")[0].style.display = "none";
}
///////////给category_tab设置效果/////////////
;(function(){
	var categoryBrand = document.getElementById("category_brand");
	//console.log(nav.children)
//	var oLi = nav.getElementsByTagName("li");//不能选用这个，因为nav下有两个li
	var oLi = categoryBrand.children;//而nav的孩子之选第一层的，不管孙子元素				
	for(let i=0;i<oLi.length;i++){
		oLi[i].onmouseover = function(){
			oLi[i].style.backgroundColor= "#f4c11a";
			var oUl = categoryBrand.getElementsByTagName('ul')
//			console.log(oUl)
			for(let j =0;j<oUl.length;j++){
				oUl[j].style.display = 'none'
			}
			//console.log(this)//第一层的li
			this.getElementsByTagName('ul')[0].style.display = 'block';
		}
		oLi[i].onmouseout = function(){
			oLi[i].style.backgroundColor= "#f8f9fb";
			this.getElementsByTagName('ul')[0].style.display = 'none';
		}
	}
})()

/////////////////设备回收 //////////////////////
;(function(){
	var equipment = document.getElementById("equipment")
	var equipmentLi = equipment.getElementsByTagName("li");
	for(let i=0;i<equipmentLi.length;i++){
		equipmentLi[i].onclick = function(){
			equipment.querySelector(".focus").className ="";
			equipmentLi[i].className = "focus";
		}
	}
})()

////回收手机列表//////////////////////////
;(function(){
	var brand = document.getElementById("brand");
	var oLi = brand.children;//而nav的孩子之选第一层的，不管孙子元素				
	for(let i=0;i<oLi.length;i++){
		oLi[i].onclick = function(){
//			oLi[i].style.backgroundColor= "#f4c11a";
			var oUl = brand.getElementsByTagName('ul')
			for(let j =0;j<oUl.length;j++){
				oUl[j].style.display = 'none'
			}
			//console.log(this)//第一层的li
			this.getElementsByTagName('ul')[0].style.display = 'block';
		}
//		oLi[i].onmouseout = function(){
//			this.getElementsByTagName('ul')[0].style.display = 'none';
//		}
	}
})()

/////////////////媒体报道///////////////////////////
;(function(){
	var main = document.querySelectorAll(".main1")
	var mainContent = document.querySelectorAll(".main1_right");
	//console.log(mainContent)
	for(let j=0;j<mainContent.length;j++){
		mainContent[j].onmouseover = function(){
			mainContent[j].querySelector("h3").style.color = "#3bb6ff"
		}
		mainContent[j].onmouseout = function(){
			mainContent[j].querySelector("h3").style.color = "black"
		}
	}
	
	 var newsList = document.querySelectorAll(".news_list");
//	 console.log(newsList)
	for(let r=0;r<newsList.length;r++){
		newsList[r].onmouseover = function(){
			newsList[r].getElementsByTagName("span")[1].style.color = "#3bb6ff"
		}
		newsList[r].onmouseout = function(){
			newsList[r].getElementsByTagName("span")[1].style.color = "black"
		}
	}
})()

